<?php

/**
 * 达B率统计
 * 
 * @version 1.0
 * @author jinyue.wang
 * @date 2013-12-15
 */

class DefaultController extends FController {

    public function accessRules() {
        $config = array(
            'index' => 1
        );
        return ZRole::auth("electives", $config);
    }

    public function __common() {
        parent::init();
        if (empty($this->cLoginUser)) {
            $this->redirect($this->createUrl('/site/login'));
        }

        $this->commonScript();
        Yii::app()->clientScript->registerCssFile(THEME_CSS_URL . '/module_Sip.css');
    }

    public function actionIndex() {
        $this->__common();
        
        $zExam = new zExam();
        $examArray = $zExam->_getExamObject();
        
        $zEdu = new ZEdu();  
        $schoolObject = $zEdu->_getSchoolInfo();
        
        $this->title = '选修课双B及单科达B率';
        $this->render('index',array(
            'examArray' => $examArray,
            'schoolObject' => $schoolObject
        ));
    }

    public function actionList(){
        
        $this->__common();
        $this->layout = "//layouts/main_other";
        
        Yii::app()->clientScript->registerScriptFile(STATICS_URL . "/js/Highcharts/js/highcharts.js");
        Yii::app()->clientScript->registerScriptFile(STATICS_URL . "/js/Highcharts/js/modules/exporting.js");

        $exam_id = $this->request->getParam('exam_id');
        $school_id = $this->request->getParam('school_id');
        
        
        
        $this->render('list',array(
            
        ));
    }
    
}